package cn.wangsy.zhidao.p20170116;

import java.util.ArrayList;
import java.util.List;

public class SumAndAvg {

	public static void main(String[] args) {

		List<Integer> scores = new ArrayList<Integer>();
		scores.add(78);
		scores.add(90);
		scores.add(67);
		scores.add(81);
		
		int sum = 0;
		int max = 0;
		for(Integer score:scores){
			sum += score;
			if(score > max){
				max = score;
			}
		}
		double avg = 0;
		if(scores.size() > 0){
			avg = sum *1.0 / scores.size();
		}
		System.out.println("最高分："+max+";平均分："+avg);
		
		Float.parseFloat("12.3");
		
	}

}
